//
//  UINavigationController+ZZUtil.m
//  ZZKitDemo
//
//  Created by hfzhangzhang on 2018/8/8.
//  Copyright © 2018年 hfzhangzhang. All rights reserved.
//

#import "UINavigationController+ZZUtil.h"
#import "DynamicTools.h"

@implementation UINavigationController (ZZUtil)
+ (void)load {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        Class aClass = [self class];
        Swizzle_(aClass, NSSelectorFromString(@"pushViewController:animated:"), @selector(login_pushViewController:animated:));
    });
}

- (void)login_pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    
   // NSArray *allowedClasses = @[@"MyListViewController", @"MySpaceViewController"];
    
   // NSString *currentClass = NSStringFromClass([viewController class]);

//    if([allowedClasses containsObject:currentClass] && ![[LoginHelper helper] isLogin]){
//        LoginViewController *loginVC = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
//        [self login_pushViewController:loginVC animated:animated];
//    } else {
        [self login_pushViewController:viewController animated:animated];
 //   }
    
}
@end
